import axios from "axios";
// axios.defaults.headers.common['token'] = localStorage.getItem('token')  // 在header中添加token
import {
  Host_Ip2
} from "../config.js"


// 获取验证图片  以及token
function getCaptcha (data) {
    return axios({
      url: Host_Ip2 + '/captcha/get',
      method: 'post',
      data
    })
  }
  
// 滑动或者点选验证
function captchaCheck (data) {
    return axios({
        url: Host_Ip2 + '/captcha/check',
        headers: { 'Authorization': `Bearer ${localStorage.getItem('imgToken')}` },
        method: 'post',
        data
    })
}

export {
    getCaptcha,
    captchaCheck
}